package branchws;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Atuan
 */
public class Order {
    private List<OrderItem> items;
    private Client client;
    private int id;

    public Order(Client client) {
        this.client = client;
        this.items = new ArrayList<OrderItem>();
    }
    
    public Order(){
        this.items = new ArrayList<OrderItem>();
        this.client = null;        
    }    
    
    public Order(int id, Client client,List<OrderItem> items){
        this.id = id;
        this.items = items;
        this.client = client;        
    }
    
    public void addItem(OrderItem item){
        items.add(item);
    }
    
    public void removeItem(OrderItem item){
        items.remove(item);
    }
    
    public int getOrderListSize(){
        return items.size();
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
    public OrderItem getItem(int index){
        return items.get(index);
    }

    public Client getClient() {
        return client;
    }

    public void setClient(Client client) {
        this.client = client;
    }

    public List<OrderItem> getItems() {
        return items;
    }

    public void setItems(List<OrderItem> items) {
        this.items = items;
    }
}
